<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改车辆-车辆参数配置-动力系统参数')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-edit" th:object="${carInfo}">
            <input name="carInfoId" th:field="*{carInfoId}" type="hidden">
            <input name="carId" th:field="*{carId}" type="hidden">
            <input name="menuId" th:field="*{menuId}" type="hidden">
            <input name="configType" th:field="*{configType}" type="hidden">
            <input id="car_info" name="info" th:field="*{info}" type="hidden">
            <div class="form-group" th:if="${carInfo.carInfoId!=null}">
                <label class="col-sm-2 control-label">图片</label>
                <div class="col-sm-10" th:include="system/common/file_upload :: multiple_img(_file_id='multipleFile',_file_type='img',_file_list=${@file.getFiles(carInfo.carId,carInfo.configType)})"/>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        发动机参数
                    </h3>
                </div>
                <div class="panel-body">
                    <span class="form-horizontal" role="form">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">发动机型号：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.engineModel" th:field="*{infoMap.engineModel}" class="form-control" type="text" required>
                        </div>
                        <label class="col-sm-2 control-label">最大马力：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxHorsepower" th:field="*{infoMap.maxHorsepower}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">排量（L/ml）：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.displacement" th:field="*{infoMap.displacement}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最大功率（KW）：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPower" th:field="*{infoMap.maxPower}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">进气形式：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.intakeForm" th:field="*{infoMap.intakeForm}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最大功率转速（rpm）：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.maxPowerSpeed}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">气缸排列形式：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.cylinderArrangement}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最大扭矩（N·m）：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.maximumTorque}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">气缸数（个）：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.numberCylinders}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">燃油类型：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.fuelType}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">气门数（个）：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.numberValves}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">燃油标号：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.fuelLabel}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">压缩比：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.compressionRatio}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">供油方式：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.oilSupplyMethod}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">配气机构：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.airSupply}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">环保标准：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.environmentalStandards}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">缸径(mm)x行程（mm)：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.bore}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">喷油方式：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.fuelInjection}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">涡轮增压方式：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.turboMode}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">点火次序：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.firingOrder}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">缸套形式：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.linerForm}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">缸体主要材质：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.mainMaterialCylinder}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">气门室盖材质：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.valveCoverMaterial}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">气缸材质：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.cylinderMaterial}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">油底壳材质：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.maxPowerSpeed" th:field="*{infoMap.oilPanMaterial}" class="form-control" type="text">
                        </div>
                    </div>
                    </span>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        变速箱参数
                    </h3>
                </div>
                <div class="panel-body">
                    <span class="form-horizontal" role="form">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">变速箱类型：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.transmissionType" th:field="*{infoMap.transmissionType}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">变速箱型号：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.transmissionModel" th:field="*{infoMap.transmissionModel}" class="form-control" type="text" required>
                        </div>
                        <label class="col-sm-2 control-label">档数：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.numberFrames" th:field="*{infoMap.numberFrames}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">换挡类型：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.shiftType" th:field="*{infoMap.shiftType}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">转动类型：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.rotationType" th:field="*{infoMap.rotationType}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">离合器类型：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.clutchType" th:field="*{infoMap.clutchType}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">壳体材料：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.shellMaterial" th:field="*{infoMap.shellMaterial}" class="form-control" type="text">
                        </div>
                        </div>
                        <div class="form-group">
                        <label class="col-sm-2 control-label">速比1：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio1" th:field="*{infoMap.speedRatio1}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比2：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio2" th:field="*{infoMap.speedRatio2}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比3：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio3" th:field="*{infoMap.speedRatio3}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比4：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio4" th:field="*{infoMap.speedRatio4}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比5：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio5" th:field="*{infoMap.speedRatio5}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比6：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio6" th:field="*{infoMap.speedRatio6}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比7：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio7" th:field="*{infoMap.speedRatio7}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比8：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio8" th:field="*{infoMap.speedRatio8}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比9：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatio9" th:field="*{infoMap.speedRatio9}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">速比R：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.speedRatioR" th:field="*{infoMap.speedRatioR}" class="form-control" type="text">
                        </div>
                        </div>

                        <div class="form-group">
                        <label class="col-sm-2 control-label">齿比1：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio1" th:field="*{infoMap.gearRatio1}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比2：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio2" th:field="*{infoMap.gearRatio2}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比3：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio3" th:field="*{infoMap.gearRatio3}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比4：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio4" th:field="*{infoMap.gearRatio4}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比5：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio5" th:field="*{infoMap.gearRatio5}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比6：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio6" th:field="*{infoMap.gearRatio6}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比7：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio7" th:field="*{infoMap.gearRatio7}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比8：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio8" th:field="*{infoMap.gearRatio8}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比9：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatio9" th:field="*{infoMap.gearRatio9}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">齿比R：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.gearRatioR" th:field="*{infoMap.gearRatioR}" class="form-control" type="text">
                        </div>
                        </div>
                        <div class="form-group">
                        <label class="col-sm-2 control-label">最终传动比1：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio1" th:field="*{infoMap.finalDriveRatio1}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比2：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio2" th:field="*{infoMap.finalDriveRatio2}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比3：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio3" th:field="*{infoMap.finalDriveRatio3}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比4：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio4" th:field="*{infoMap.finalDriveRatio4}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比5：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio5" th:field="*{infoMap.finalDriveRatio5}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比6：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio6" th:field="*{infoMap.finalDriveRatio6}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比7：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio7" th:field="*{infoMap.finalDriveRatio7}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比8：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio8" th:field="*{infoMap.finalDriveRatio8}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比9：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatio9" th:field="*{infoMap.finalDriveRatio9}" class="form-control" type="text">
                        </div>
                        <label class="col-sm-2 control-label">最终传动比R：</label>
                        <div class="col-sm-2">
                            <input name="infoMap.finalDriveRatioR" th:field="*{infoMap.finalDriveRatioR}" class="form-control" type="text">
                        </div>
                        </div>
                    </div>
                    </span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"></label>
                <div class="col-sm-8"><button type="button" class="btn btn-success" onclick="submitHandler()">上传</button></div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/car/info";
        $("#form-info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                let json=$('#form-info-edit').serializeJson();
                console.log(json)
                $('#car_info').val(JSON.stringify(json.infoMap)||'{}');
                let serialize = $('#form-info-edit').serialize();
                console.log(serialize)
                // console.log(JSON.stringify($('#form-info-edit').serializeJson()))
                // return;
                $.operate.save(prefix + "/edit?_="+Math.random(), serialize);
            }
        }
        $(function (){
            multipleFile_manager.init({busId: [[${carInfo.carId}]], busType: [[${carInfo.configType}]], fileType: 'img'});
        });
    </script>
</body>
</html>